<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <script src="js/bootstrap.min.js" ></script>
</head>
<body>
<form class="form-horizontal"   th:action="@{/edit}" th:object="${user}"  method="post">
  <!--隐藏用户 ID-->
  <input type="hidden" name="id" th:value="*{id}" />
  <div class="form-group">
    <label for="userName" class="col-sm-2 control-label">userName</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="username"  id="userName" th:value="*{username}" placeholder="userName"/>
    </div>
  </div>
  <div class="form-group">
    <label for="password" class="col-sm-2 control-label" >passWord</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" name="password" id="passWord"  th:value="*{password}" placeholder="passWord"/>
    </div>
  </div>
  <div class="form-group">
    <label for="age" class="col-sm-2 control-label" >age</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="age" id="age" placeholder="请输入年龄" th:value="*{age}"/>
    </div>
  </div>

  <!--错误信息-->
  <div class="form-group">
    <label  class="col-sm-2 control-label"></label>
    <div class="col-sm-10">
      <div th:if="${errorMsg != null}"  class="alert alert-danger" role="alert" th:text="${errorMsg}">

      </div>
    </div>
  </div>

  <!--按钮区-->
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <input type="submit" value="Submit" class="btn btn-info" />
      &nbsp; &nbsp; &nbsp;
      <a  th:href="@{/list}" class="btn btn-info">Back</a>
    </div>

  </div>
</form>
</body>
</html>